import sys
from pathlib import Path
from appConfig.appConfig import SharedAppConfig

from PySide2.QtWidgets import QApplication

from widget.mainWindow import AutoClickMainWindow


if __name__ == '__main__':

    app = QApplication(sys.argv)
    css = Path('appStyleSheet.css')
    main = AutoClickMainWindow()
    if css.exists():
        main.setStyleSheet(css.read_text())
    main.show()
    exit_id = app.exec_()
    SharedAppConfig.save_config()
    sys.exit(exit_id)